#ifndef GRAPH_DEF
#define GRAPH_DEF

#include "datatype.hpp"


struct AdjUnit
{
    vid_t neighbor;
};

struct AdjList
{
    AdjUnit *begin;
    AdjUnit *end;
    void init()
    {
        begin = nullptr;
        end = nullptr;
    }
    void printAdjList()
    {
        for(AdjUnit *p = begin; p < end; p++){
            logstream(LOG_INFO) << p->neighbor << " ";
        }
        std::cout << std::endl;
    }
};


struct EdgeContainer
{
    AdjList *adj_lists;
    AdjUnit *adj_units;
    EdgeContainer() : adj_lists(nullptr), adj_units(nullptr) {}
    ~EdgeContainer()
    {
        if (adj_lists != nullptr) delete []adj_lists;
        if (adj_units != nullptr) delete []adj_units;
    }
};

#endif